package Controller;

import Service.CarRentalService;
import pojo.RentalRecord;

import java.sql.SQLException;
import java.util.List;

public class CarRentalController {
    private static CarRentalService carRentalService;

    public CarRentalController() throws Exception {
        carRentalService = new CarRentalService();
    }
    public static List<RentalRecord> getAllRental() throws SQLException {
        return carRentalService.getAllRental();
    }

    public void updatestatus(int quit_rentalid) throws SQLException {
        carRentalService.updatestatus(quit_rentalid);
    }

    public List<RentalRecord> getRental_ByCarid(int searchText) throws SQLException {
        return carRentalService.getRental_ByCarid(searchText);
    }
}
